home *** CD-ROM | disk | FTP | other *** search
- 'Array to hold obrowse forms
-
- Const MAX_OBROWSE = 3
- Global OBrowseFormItems(MAX_OBROWSE) As FormItem
- Global OBrowseForms(MAX_OBROWSE) As OBrowseForm
-
- Global OBrowseSchema() As TABLESCHEMA
-
- Sub InitOBrowse ()
- FormInit OBrowseFormItems()
-
- ReDim OBrowseSchema(14)
-
- ' Determines the record type, always present
-
- OBrowseSchema(1).tsName = "IsDetail"
- OBrowseSchema(1).tsType = DB_BOOLEAN
-
- ' Present in header and detail record, value is the
- ' same for both
-
- OBrowseSchema(2).tsName = "OrderNo"
- OBrowseSchema(2).tsType = DB_LONG
-
- ' Present only in header, NULL in detail records
-
- OBrowseSchema(3).tsName = "CustNo"
- OBrowseSchema(3).tsType = DB_LONG
-
- OBrowseSchema(4).tsName = "CustName"
- OBrowseSchema(4).tsType = DB_TEXT
- OBrowseSchema(4).tsSize = 80
-
- OBrowseSchema(5).tsName = "OrderDate"
- OBrowseSchema(5).tsType = DB_DATE
-
- OBrowseSchema(6).tsName = "ShipAddr"
- OBrowseSchema(6).tsType = DB_TEXT
- OBrowseSchema(6).tsSize = 80
-
- OBrowseSchema(7).tsName = "ShipCity"
- OBrowseSchema(7).tsType = DB_TEXT
- OBrowseSchema(7).tsSize = 20
-
- OBrowseSchema(8).tsName = "ShipState"
- OBrowseSchema(8).tsType = DB_TEXT
- OBrowseSchema(8).tsSize = 10
-
- OBrowseSchema(9).tsName = "ShipZip"
- OBrowseSchema(9).tsType = DB_TEXT
- OBrowseSchema(9).tsSize = 20
-
- ' Present only in detail records, NULL in header
-
- OBrowseSchema(10).tsName = "PartNo"
- OBrowseSchema(10).tsType = DB_LONG
-
- OBrowseSchema(11).tsName = "Description"
- OBrowseSchema(11).tsType = DB_TEXT
- OBrowseSchema(11).tsSize = 80
-
- OBrowseSchema(12).tsName = "Quantity"
- OBrowseSchema(12).tsType = DB_INTEGER
-
- OBrowseSchema(13).tsName = "Price"
- OBrowseSchema(13).tsType = DB_CURRENCY
-
- ' Present in both, full total for order header
-
- OBrowseSchema(14).tsName = "Total"
- OBrowseSchema(14).tsType = DB_CURRENCY
-
- End Sub
-
- Sub OBrowseOpen (fname As String, tbname As String)
-
- ' Open a new order browser and set up its form
- ' structure
-
- If Not FormAvail(OBrowseFormItems()) Then
- MsgBox "Cannot open more order browsers"
- Exit Sub
- End If
-
- i% = FormAlloc(OBrowseFormItems())
- OBrowseFormItems(i%).fiFileName = fname
- OBrowseFormItems(i%).fiTable = tbname
-
- Set OBrowseForms(i%) = New OBrowseForm
- OBrowseForms(i%).Show
- OBrowseForms(i%).Caption = "[" + ExtractBase(fname) + "]" + TnameDisp(tbname)
-
- End Sub
-
-